package cn.gailvlun.gll.presentation.apartment.room;

import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;

import cn.gailvlun.gll.R;
import cn.gailvlun.gll.presentation.base.BaseActivity;
import cn.gailvlun.gll.databinding.ActivityMatchRuleBinding;
import cn.gailvlun.gll.util.SPUtil;



public class MatchRuleActivity extends BaseActivity {

    public static void openActivity(Context context, int roomId) {
        Intent intent = new Intent(context, MatchRuleActivity.class);
        intent.putExtra("roomId", roomId);
        context.startActivity(intent);
    }

    private ActivityMatchRuleBinding mBinding;
    private int mRoomId;

    @Override
    protected void initComponent() {
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_match_rule);
        mBinding.setPresenter(new Presenter());
    }

    @Override
    protected void createHandler() {

    }

    @Override
    protected void loadData(@Nullable Bundle savedInstanceState) {
        mRoomId = getIntent().getIntExtra("roomId", -1);
        if (mRoomId == -1) {
            finish();
        }
    }

    public class Presenter {
        public void onKnow() {
            MatchProfileActivity.openActivity(mContext, mRoomId);
            SPUtil.put(SPUtil.USER, "isSingleRuleRead", true);
            finish();
        }
    }
}
